package com.web.employees;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.util.AuthenticateHttpServlet;
import com.util.AuthenticateSession;

/**
 * Servlet implementation class ProductHandler
 */
@WebServlet("/Employee/CreateForm")
public class EmployeeCreateForm extends AuthenticateHttpServlet {
	private static final long serialVersionUID = 1L;

	protected void post(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {			
			AuthenticateSession session = (AuthenticateSession)request.getSession().getAttribute("authenticateSession");
			if (session != null) {
				request.setAttribute("username", session.getUsername());
				request.getRequestDispatcher("/WEB-INF/jsp/employeeCreate.jsp").forward(request,
						response);
			}
			else {
				request.getRequestDispatcher("/login.jsp").forward(request,
						response);
				
			}
	}
}
